home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
CCDBMS.ZIP
/
DBCMD.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-03-18
|
1KB
|
59 lines
// =================================================================
// Dbase.cpp
// =================================================================
// Harold Kasperink / John Dekker
// Dr. Dobb's Journal 1997
// =================================================================
// Dbase command class
// =================================================================
#ifndef _DBCMD_H
#define _DBCMD_H
#ifdef _WIN32
#include <afxwin.h>
#endif
class CDbase;
////////////////////////////////////////////////////////////////////
// CDbCommand::CDbCommand
////////////////////////////////////////////////////////////////////
class CDbCommand
{
private:
friend class CDbase;
CDbase * m_pDbase;
protected:
long m_lSql;
const char *m_pszFile;
long m_lLine;
public:
CDbCommand();
CDbCommand(CDbase &dbase);
virtual ~CDbCommand();
// You should call dbase.Do(this)
virtual void Do() = 0;
// Set operations used for Error handling
void Location(const char *pszFile, long lLine);
void Sql(long lSql);
// Throws database exception
void ThrowDbError(boolean bUnlock = TRUE);
// Get and set functions
CDbase * Dbase();
void Dbase(CDbase &dbase);
private:
// Is called by database object to instruct command to go !
virtual long Execute() = 0;
};
#endif